{extend name="base" /}

{block name="title"}投注 - 幸运10分{/block}

{block name="resource"}
<style type="text/css">
	.qb_box {
		margin-bottom: 10px;
	}
</style>
{/block}

{block name="main"}
	<div class="main">
		<div class="container">
			<div class="vip">
				<dl class="vip_box">
					<dt class="vip_title">投注</dt>
					<dd class="vip_contai">
						{php}
							$userId = \think\Session::get('user_id');
							$numDetail = json_decode($lastLotteryLog->num_detail, true);
							$issetNumDetail = isset($numDetail[$userId]);
						{/php}
						{if condition="isset($numDetail[$userId])"}
							<div class="qb_box clearfix">
								<p>你第{$lastLotteryLog->getData('create_time')|date="Ymd",###}-{$lastLotteryLog['lottery_2_log_id']}期购买的号码：
									{volist name="numDetail[$userId]" id="num"}
										<strong style="color: red;">{$num}</strong> | 
									{/volist}
								</p>
							</div>
						{/if}

						<div class="qb_box clearfix">
							<p>每个用户最多可以购买：<strong style="color: red;">{:getParamLottery('LOTTERY_2_EACH_USER_BUY_NUM')}</strong>个号码</p>
							<p>每个号码：<strong style="color: red;">{:getParamLottery('LOTTERY_2_EACH_PRICE')}</strong>个金钱</p>
						</div>

						<div class="kthy_box clearfix">
							<form action="/game/lottery/two/handleSale" method="post">
								<div>
									{for start="$LOTTERY_MIN_NUM" end="$LOTTERY_MAX_NUM" comparison="elt" name="num" }
										{if condition="$issetNumDetail AND in_array($num, $numDetail[$userId])"}
											<label class="col-md-2"><s>号码：{$num}</s></label>
											{else/}
											<label class="col-md-2"><input type="radio" name="num" value="{$num}"/>号码：{$num}</label>
										{/if}
									{/for}
								</div>
								<div class="ktvip_btn">
									<button type="submit" onclick="return confirm('确认投注？')">投注</button>
								</div>
							</form>
						</div>
					</dd>
				</dl>
			</div>
		</div>
	</div>
{/block}